<?php
class Jasper extends Controller {
	
	public function __construct()
  {
    parent::Controller();
  }

  public function index() {
    
  }
  
  public function executeReport($jasperfile = '') {
    $this->load->library('PHPJasperXML');
    require APPPATH.'/config/database.php'; 
    
    if ($jasperfile == '') {
      return;
    }

    $jasperfile = APPPATH.'/jreports/'.$jasperfile;
    $xml = simplexml_load_file($jasperfile);
    
    @$PHPJasperXML = new PHPJasperXML();
    @$PHPJasperXML->debugsql=false;
    @$PHPJasperXML->arrayParameter = $arrayParameters;
    @$PHPJasperXML->xml_dismantle($xml);
    @$PHPJasperXML->transferDBtoArray(
      $db['default']['hostname'],
      $db['default']['username'],
      $db['default']['password'],
      $db['default']['database']
    );
    @$PHPJasperXML->outpage("I");    //page output method I:standard output  D:Download file
  }
}
  